<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
    
<h:head>
	<title>#{userBean.name} - Acquisti</title>
</h:head>

<h:body>
	<br/>
	<h1>Regali Fatti</h1>
	<p:dataList value="#{acquisti.regaliEffettuati}" var="regalo"  itemType="Regali Effettuati">  
    	#{regalo}  
	</p:dataList> 
	<br/>
	<h1>Regali Ricevuti</h1>
	<p:dataList value="#{acquisti.regaliRicevuti}" var="regalo"  itemType="Regali Ricevuti">  
    	#{regalo}  
	</p:dataList> 
	<h1>Acquisti Effettuati</h1>
	<h:form>
		<p:selectManyCheckbox id="lista" value="#{acquisti.selectedItems}" layout="grid" columns="1" >  
    		<f:selectItems value="#{acquisti.acquisti}" />
   	 	</p:selectManyCheckbox> 
     
    	<p:commandButton value="Rimuovi"  actionListener="#{acquisti.remove}" rendered="true" update="lista">
    		<p:confirm header="Elimina" message="Eliminare gli elementi selezionati?" icon="ui-icon-alert"/>
    	</p:commandButton>
   		<p:commandButton value="OK" action="index" rendered="true"/>
    	<p:confirmDialog rendered="true" global="true" showEffect="fade" hideEffect="explode">  
       		<p:commandButton rendered="true" value="Si" update="lista" styleClass="ui-confirmdialog-yes" icon="ui-icon-check"/> 
       		<p:commandButton rendered="true" value="No"  styleClass="ui-confirmdialog-no" icon="ui-icon-close"/>       
    	</p:confirmDialog>  
    </h:form>
</h:body>
    
</html>